package com.amazon.inapp.purchasing;

import android.content.Context;
import android.os.Handler;
import android.os.HandlerThread;
import java.util.HashMap;
import java.util.Map;

class HandlerManager
{
  private static volatile Map<String, HandlerAdapter> HANDLER_ADAPTERS = new HashMap();
  private static volatile HandlerAdapter MAIN_HANDLER_ADAPTER = null;

  static HandlerAdapter getHandlerAdapter(String paramString)
  {
    if (!HANDLER_ADAPTERS.containsKey(paramString));
    try
    {
      if (!HANDLER_ADAPTERS.containsKey(paramString))
      {
        HandlerThread localHandlerThread = new HandlerThread(paramString);
        localHandlerThread.start();
        HandlerAdapter localHandlerAdapter = new HandlerAdapter(new Handler(localHandlerThread.getLooper()));
        HANDLER_ADAPTERS.put(paramString, localHandlerAdapter);
      }
      return (HandlerAdapter)HANDLER_ADAPTERS.get(paramString);
    }
    finally
    {
    }
  }

  static HandlerAdapter getMainHandlerAdapter()
  {
    if (MAIN_HANDLER_ADAPTER == null);
    try
    {
      if (MAIN_HANDLER_ADAPTER == null)
        MAIN_HANDLER_ADAPTER = new HandlerAdapter(new Handler(PurchasingManager.getObserverContext().getMainLooper()));
      return MAIN_HANDLER_ADAPTER;
    }
    finally
    {
    }
  }

  static void setHandlerAdapter(String paramString, HandlerAdapter paramHandlerAdapter)
  {
    HANDLER_ADAPTERS.put(paramString, paramHandlerAdapter);
  }

  static void setMainHandlerAdapter(HandlerAdapter paramHandlerAdapter)
  {
    MAIN_HANDLER_ADAPTER = paramHandlerAdapter;
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.amazon.inapp.purchasing.HandlerManager
 * JD-Core Version:    0.6.2
 */